Edit method let us show a field of another table and tie it with a field of our table. In this sample ServiceObjectId fields value changes related with ItemId updates. We get ServiceObjectId fields value, put ItemId which has this ServiceObjectId value. When ItemId changed we update ServiceObjectId value.
edit ItemId EditItemId(boolean set, ItemId _ItemId)
{
ItemId ret;
;
if (set)
{
this.ServiceObjectId =
SMAServiceObjectTable::findItem(_ItemId).ServiceObjectId;
}
else
{
ret = SMAServiceObjectTable::find(this.ServiceObjectId).ItemId;
}
return ret;
}
Set boolean value selects if editmethod will work for update or just display. If set true it's mean second parameter (in this case _ItemId ) filled from user. Else editmethod value cames from related field value.
2 Aralık 2011 Cuma
AXAPTA splitter control
There isn't a true splitter control in Axapta. There is a class made by group panels. There are a lot of forms use this control.
Write these at ClassDeclaration:
First was for vertical splitter, second was horizontal. Put this code part to forms init method:
_VerticalSplitter = new SysFormSplitter_X(VerticalSplitter,groupLeft,element);
_HorizontalSplitter = new SysFormSplitter_Y(HorizontalSplitter,groupTop,element);
Arrangements for vertical splitter:
VerticalSplitter at up is group control for use vertical splitter control. It parameters are:
AlignChild = No
AlignControl = Yes
AutoDeclaration = Yes
BackgroundColor = Window background
FrameType = Raised 3D
HideifEmpty = No
Height = Column height
Width = 5
We put two group controls of vertical splitter one is left and one is right and it's parents column value should 3. This is important for a correct screening.Make Autodeclaration = Yes for left group. (It's name is groupLeft at upper). It's Height value must be Column Height, Width may be like 100-200, width value will be change and save after we move the splitter. Right groups height value should be column height and width value should be column width.
Vertical splitters methods are should be like:
int mouseDown(int x, int y, int button, boolean ctrl, boolean shift)
{
int ret;
ret = super(x, y, button, ctrl, shift);
Return _VerticalSplitter.mouseDown(x, y, button, ctrl, shift);
}
Arrangements for horizontal splitter:
I'll just tell differences with vertical.Different parameters:
Columns = 1 for splitters parent control.
Height = 5
Width =Column Width
Upper groups name is groupTOP for our sample. Height value may be like 100-200 and Width value is Column width. Methods names different; instead of _VerticalSplitter, _HorizontalSplitter. Lower groups Width value is Column Width and Height value is Column Height.
Write these at ClassDeclaration:
SysFormSplitter_X _VerticalSplitter;
SysFormSplitter_Y _HorizontalSplitter;
SysFormSplitter_Y _HorizontalSplitter;
First was for vertical splitter, second was horizontal. Put this code part to forms init method:
_VerticalSplitter = new SysFormSplitter_X(VerticalSplitter,groupLeft,element);
_HorizontalSplitter = new SysFormSplitter_Y(HorizontalSplitter,groupTop,element);
Arrangements for vertical splitter:
VerticalSplitter at up is group control for use vertical splitter control. It parameters are:
AlignChild = No
AlignControl = Yes
AutoDeclaration = Yes
BackgroundColor = Window background
FrameType = Raised 3D
HideifEmpty = No
Height = Column height
Width = 5
We put two group controls of vertical splitter one is left and one is right and it's parents column value should 3. This is important for a correct screening.Make Autodeclaration = Yes for left group. (It's name is groupLeft at upper). It's Height value must be Column Height, Width may be like 100-200, width value will be change and save after we move the splitter. Right groups height value should be column height and width value should be column width.
Vertical splitters methods are should be like:
int mouseUp(int x, int y, int button, boolean ctrl, boolean shift)
{
int ret;
ret = super(x, y, button, ctrl, shift);
Return _VerticalSplitter.mouseUp(x, y, button, ctrl, shift);
}
{
int ret;
ret = super(x, y, button, ctrl, shift);
Return _VerticalSplitter.mouseUp(x, y, button, ctrl, shift);
}
int mouseMove(int x, int y, int button, boolean ctrl, boolean shift)
{
int ret;
ret = super(x, y, button, ctrl, shift);
Return _VerticalSplitter.mouseMove(x,y,button,ctrl,shift);
}
{
int ret;
ret = super(x, y, button, ctrl, shift);
Return _VerticalSplitter.mouseMove(x,y,button,ctrl,shift);
}
{
int ret;
ret = super(x, y, button, ctrl, shift);
Return _VerticalSplitter.mouseDown(x, y, button, ctrl, shift);
}
Arrangements for horizontal splitter:
I'll just tell differences with vertical.Different parameters:
Columns = 1 for splitters parent control.
Height = 5
Width =Column Width
Upper groups name is groupTOP for our sample. Height value may be like 100-200 and Width value is Column width. Methods names different; instead of _VerticalSplitter, _HorizontalSplitter. Lower groups Width value is Column Width and Height value is Column Height.
1 Aralık 2011 Perşembe
AXAPTA Edit data group dropped to form from table?
For add new field you have to do AutoDataGroup = NO. For change or delete make DataGroup to empty.
AXAPTA work with address tables
We have to join some tables. In my sample we will try to get a vendors address:
DirPartyAddressRelationShip dirPartyAddressRelationShip;
DirPartyAddressRelationShipMapping dirPartyAddressRelationShipMapping;
Address address;
;
select firstonly * from DirPartyAddressRelationShip join
dirPartyAddressRelationShipMapping join address
order by
DirPartyAddressRelationShip.Shared desc,
DirPartyAddressRelationShip.IsPrimary desc
where DirPartyAddressRelationShip.PartyId == VendTable::find(vendPAckingSlipJour.OrderAccount).PartyId &&
dirPartyAddressRelationShipMapping.PartyAddressRelationshipRecId == dirPartyAddressRelationShip.RecId &&
address.RecId == dirPartyAddressRelationShipMapping.AddressRecId &&
address.type == AddressType::Service;
DirPartyAddressRelationShip table ties source table with (source table in this sample is VendTable) addresses. In this sample VendTable tables PartyId field join with DirPartyAddressRelationShip table.
Address tables name is Address. DirPartyAddressRelationShipMapping table is a bridge between DirPartyAddressRelationShip and Address tables. DirPartyAddressRelationShipMapping tables PartyAddressRelationshipRecId field related with DirPartyAddressRelationShip tables RecId field. DirPartyAddressRelationShipMapping tables AddressRecId field related with Address tables RecId field.
DirPartyAddressRelationShip dirPartyAddressRelationShip;
DirPartyAddressRelationShipMapping dirPartyAddressRelationShipMapping;
Address address;
;
select firstonly * from DirPartyAddressRelationShip join
dirPartyAddressRelationShipMapping join address
order by
DirPartyAddressRelationShip.Shared desc,
DirPartyAddressRelationShip.IsPrimary desc
where DirPartyAddressRelationShip.PartyId == VendTable::find(vendPAckingSlipJour.OrderAccount).PartyId &&
dirPartyAddressRelationShipMapping.PartyAddressRelationshipRecId == dirPartyAddressRelationShip.RecId &&
address.RecId == dirPartyAddressRelationShipMapping.AddressRecId &&
address.type == AddressType::Service;
DirPartyAddressRelationShip table ties source table with (source table in this sample is VendTable) addresses. In this sample VendTable tables PartyId field join with DirPartyAddressRelationShip table.
Address tables name is Address. DirPartyAddressRelationShipMapping table is a bridge between DirPartyAddressRelationShip and Address tables. DirPartyAddressRelationShipMapping tables PartyAddressRelationshipRecId field related with DirPartyAddressRelationShip tables RecId field. DirPartyAddressRelationShipMapping tables AddressRecId field related with Address tables RecId field.
DirPartyAddressRelationShip tables Shared field is shown in vendor form addres tab->general field, IsPrimary alanı da Birincil alanına denk geliyor. Type field is address types combobox. I wanted to get service address so selected as AddressType::Service enum value.
AXAPTA icase equivalent in axapta and today
b = a > SystemDateGet() ? "büyük" : "küçük"
AXAPTA TC Id field
This is just about turkish users:
There is an extended data type for TC id: IdentityNum_TR . But it's lenght incorrect (12). Should be 11.
There is an extended data type for TC id: IdentityNum_TR . But it's lenght incorrect (12). Should be 11.
AXAPTA refreshing records
repairjournal_ds.research();
repairjournal_ds.refresh();
If you want to stay at current record:
repairjournal_ds.research(true);
repairjournal_ds.refresh();
repairjournal_ds.refresh();
If you want to stay at current record:
repairjournal_ds.research(true);
repairjournal_ds.refresh();
Kaydol:
Kayıtlar (Atom)