hey am a new at dynamics nav and i am having a problem in getting all the values of a record from C/AL code
Example:The Vendor Card Form
I have added a new button to that form and i am sending some values to a webservice.
On clicking on the button i need to send the related record with all it's values to the webservice
like :select * from vendore where No.="the id related to the opened vendor" but i need to do that in C/AL
0
Comments
As you can see, the fields value are separated by a Tab, which could be difficult to use to send the data to another table or system.
But oh my foes and oh my friends, it gives a lovely light
Create a new test form, based on the Vendor table, just put some random fields on there. Put a button on there, and in the code of the button put this C/AL code: You should get two messages, both with the name of the current vendor. Move your cursor to a different vendor and click the button again, and verify that it puts the current Vendor name in there.
RIS Plus, LLC
is returning zeros ,i created a new test form and it has returned good data but while using the vendor card form it returns only zeros
For the second solution what if i want to make it dynamic and i don't know what are the fields name
Thank you again
eg table vendor
i need to get the fieldname and their values per record i don't care if it is going to be a datatable i will send them as string
Enabled Field No. Field Name Data Type Length Description
Yes 1 No. Code 20
Yes 2 Name Text 50
Yes 3 Search Name Code 50
Yes 4 Name 2 Text 50
Yes 5 Address Text 50
Yes 6 Address 2 Text 50
Yes 7 City Text 30
Yes 8 Contact Text 50
Yes 9 Phone No. Text 30
Yes 10 Telex No. Text 20
Yes 14 Our Account No. Text 20
Yes 15 Territory Code Code 10
Yes 16 Global Dimension 1 Code Code 20
Yes 17 Global Dimension 2 Code Code 20
Yes 19 Budgeted Amount Decimal
Yes 21 Vendor Posting Group Code 10
Yes 22 Currency Code Code 10
Yes 24 Language Code Code 10
Yes 26 Statistics Group Integer
Yes 27 Payment Terms Code Code 10
Yes 28 Fin. Charge Terms Code Code 10
Yes 29 Purchaser Code Code 10
Yes 30 Shipment Method Code Code 10
Yes 31 Shipping Agent Code Code 10
Yes 33 Invoice Disc. Code Code 20
Yes 35 Country/Region Code Code 10
Yes 38 Comment Boolean
Yes 39 Blocked Option
Yes 45 Pay-to Vendor No. Code 20
Yes 46 Priority Integer
Yes 47 Payment Method Code Code 10
Yes 54 Last Date Modified Date
Yes 55 Date Filter Date
Yes 56 Global Dimension 1 Filter Code 20
Yes 57 Global Dimension 2 Filter Code 20
Yes 58 Balance Decimal
Yes 59 Balance (LCY) Decimal
Yes 60 Net Change Decimal
Yes 61 Net Change (LCY) Decimal
Yes 62 Purchases (LCY) Decimal
Yes 64 Inv. Discounts (LCY) Decimal
Yes 65 Pmt. Discounts (LCY) Decimal
Yes 66 Balance Due Decimal
Yes 67 Balance Due (LCY) Decimal
Yes 69 Payments Decimal
Yes 70 Invoice Amounts Decimal
Yes 71 Cr. Memo Amounts Decimal
Yes 72 Finance Charge Memo Amounts Decimal
Yes 74 Payments (LCY) Decimal
Yes 75 Inv. Amounts (LCY) Decimal
Yes 76 Cr. Memo Amounts (LCY) Decimal
Yes 77 Fin. Charge Memo Amounts (LCY) Decimal
Yes 78 Outstanding Orders Decimal
Yes 79 Amt. Rcd. Not Invoiced Decimal
Yes 80 Application Method Option
Yes 82 Prices Including VAT Boolean
Yes 84 Fax No. Text 30
Yes 85 Telex Answer Back Text 20
Yes 86 VAT Registration No. Text 20
Yes 88 Gen. Bus. Posting Group Code 10
Yes 89 Picture BLOB
Yes 91 Post Code Code 20
Yes 92 County Text 30
Yes 97 Debit Amount Decimal
Yes 98 Credit Amount Decimal
Yes 99 Debit Amount (LCY) Decimal
Yes 100 Credit Amount (LCY) Decimal
Yes 102 E-Mail Text 80
Yes 103 Home Page Text 80
Yes 104 Reminder Amounts Decimal
Yes 105 Reminder Amounts (LCY) Decimal
Yes 107 No. Series Code 10
Yes 108 Tax Area Code Code 20
Yes 109 Tax Liable Boolean
Yes 110 VAT Bus. Posting Group Code 10
Yes 111 Currency Filter Code 10
Yes 113 Outstanding Orders (LCY) Decimal
Yes 114 Amt. Rcd. Not Invoiced (LCY) Decimal
Yes 116 Block Payment Tolerance Boolean
Yes 117 Pmt. Disc. Tolerance (LCY) Decimal
Yes 118 Pmt. Tolerance (LCY) Decimal
Yes 119 IC Partner Code Code 20
Yes 120 Refunds Decimal
Yes 121 Refunds (LCY) Decimal
Yes 122 Other Amounts Decimal
Yes 123 Other Amounts (LCY) Decimal
Yes 124 Prepayment % Decimal
Yes 125 Outstanding Invoices Decimal
Yes 126 Outstanding Invoices (LCY) Decimal
Yes 130 Pay-to No. Of Archived Doc. Integer
Yes 131 Buy-from No. Of Archived Doc. Integer
Yes 5049 Primary Contact No. Code 20
Yes 5700 Responsibility Center Code 10
Yes 5701 Location Code Code 10
Yes 5790 Lead Time Calculation DateFormula
Yes 7177 No. of Pstd. Receipts Integer
Yes 7178 No. of Pstd. Invoices Integer
Yes 7179 No. of Pstd. Return Shipments Integer
Yes 7180 No. of Pstd. Credit Memos Integer
Yes 7181 Pay-to No. of Orders Integer
Yes 7182 Pay-to No. of Invoices Integer
Yes 7183 Pay-to No. of Return Orders Integer
Yes 7184 Pay-to No. of Credit Memos Integer
Yes 7185 Pay-to No. of Pstd. Receipts Integer
Yes 7186 Pay-to No. of Pstd. Invoices Integer
Yes 7187 Pay-to No. of Pstd. Return S. Integer
Yes 7188 Pay-to No. of Pstd. Cr. Memos Integer
Yes 7189 No. of Quotes Integer
Yes 7190 No. of Blanket Orders Integer
Yes 7191 No. of Orders Integer
Yes 7192 No. of Invoices Integer
Yes 7193 No. of Return Orders Integer
Yes 7194 No. of Credit Memos Integer
Yes 7195 No. of Order Addresses Integer
Yes 7196 Pay-to No. of Quotes Integer
Yes 7197 Pay-to No. of Blanket Orders Integer
Yes 7600 Base Calendar Code Code 10
RIS Plus, LLC
Are you working on the purchase order approval process in Sharepoint that was in another post?
RIS Plus, LLC
Thank you
RIS Plus, LLC
i just need to do the same but i need to get the names of the fields of the table
that's all i want i added a new global variable recfield of type record and subtype field
in CAL code i have seen many code syntax like
recfield.GET;
My question is how can i know what can i do with "recfield" like the properties of recField how can i use recfield??
i am really ssorry for disturbing but i am new and i hope u can understand how new people might interact with nav especially if they are a .net developper.
thank you again and if you can check the tableinformer example u will get to understand what i need in the tableinformer example we are able to list the fields name in a listview all i want is to put them in a string variable but because i am not much with the CAL good syntax am stuck.
RIS Plus, LLC
RecRef.OPEN(23)
RecRef.FINDFIRST;
FOR i := 1 TO RecRef.FIELDCOUNT DO BEGIN
fldItemFields := RecRef.FIELDINDEX(i);
str := STRSUBSTNO('%1 = %2',fldItemFields.NAME,fldItemFields.VALUE);
MESSAGE(str);
END;
EDIT: Arg .... your'e find it self and i forgott to press submit
regards
and then your loop after this.
Regards
with gettable(Rec) you are on the same rec in RecRef that you see on your form.
If you wan't also loop trough the rec, you can do this also with this example.
Regards
Thank you and Best regards
The loop is only an example how to get all recs in the table.
So in your case, RecRef.gettable(Rec); is enough.
The 4 in the "for" loop is also only an example (use RecRef.Fieldcount) beacuse im to lazy to press 100x Enter when the messages pops up ;-)
Regards
str :=str+ STRSUBSTNO('Field %1 has value %2',fldItemFields.NAME,fldItemFields.VALUE);
and str is a text and as u know text is with a lenght 1024 so it is always giving me a break error i tried a big text but didn't know how to use it well
Last from where i can get examples on how to use all these variables and how to know the synthax of CAL i have used the F1 seen in an earlier post of you but still it is not that much clear for a begginner in NAV especially trying to integrate sharepoint and NAV and a .net developper.
Thank you again
RIS Plus, LLC
bigtext.addtext(str);
but still i can't read it or use it wihtout writing it as a stream and the examples in the help aren't that much wide you also need to have a small knowledge in NAV to understand what they are talking about.
1-how i can create a string variable that can take more than 1024 as length. is nav that much limited??
2-i am using a com and i call it in my CAL code as automation,i have a function in c# that returns a string ok that's great i can read that from NAV,i've created another function in c# that returns an arraylist,can i read that from nav if i have created a text array,because i tried to use:
array:=format(navWs.getDocuments);
but i can never compile because i can't use array:= it has to be array[1]:= any ideas???
a small request if i am in codeunit and i want to insert values in a new table i have created how can i do that a small example might be helpfull.
Thank you and best regards
Hi,
have you ever found a solution for accessing arraylist in COM?
I have a situation where I need to give an arraylist to a function as a parameter in COM but can't manage to do that...
I found .net component that someone also gave as type library after which I can call it from NAV over COM.
In that .net component, there is one collection (of objects). In COM (through Navision) I see that collection as properties in appropriate object, to which I can pass Arraylist (of collection objects).
I know that somewhere should be Add (or Count) method but can't find it. If I pass automation (object) to that properties, it compiles but runtime error occures.
The actual question is, how can I pass arraylist (of objects) to COM function?
As i am new to navision, can u please give me the complete code