How to do ?

navuser1navuser1 Member Posts: 1,329
Hi all,

Please share your Knowledge..........

How can I flow the data from a Text Variable into a Table Field.

Suppose I have defined a Text variable named VarText in the Purchase Order form and
I want to flow this information into the table Purch. Rcpt. Header field BText & Purch. Inv. Header field C Text at time posting
Now or Never

Comments

  • BruceBruce Member Posts: 26
    edited 2008-10-18
    hi

    For Getting this Solution, U have to debug the code after Posting.

    Regards,
    Saumil Shah
  • BruceBruce Member Posts: 26
    edited 2008-10-18
    hi

    When u post the PO , At that time Debug the Code & see when it generate Purchase Receipt & Purchase Invoice.

    so after finding the code "when it transfer Fields to one table to another table",

    After that code U write yr code.
    Take a record variable of Purch.Rcpt. Header & other table u if u neeed.
    & then
    Btext := Vartext;
    CText := Vartext;



    Regards,
    Saumil Shah
  • BBlueBBlue Member Posts: 90
    Hello,

    You can define a text field in the Purchase Header table and show it on the PO form so that users will fill it.
    Then define this text field (same Field No., can have different name if you want) in the tables Purch. Rcpt. Header and Purch. Inv. Header.
    The posting codeunits will do the work for you and the information originally entered in that field on the PO will also be transferred to Purch. Rcpt. Header and Purch. Inv. Header

    Regards
    //Bogdan
  • navuser1navuser1 Member Posts: 1,329
    Thnx Shah,

    I hv resolved this problem,
    but to this I hv to Create a single instance CU.


    I want to know the other solutions.....
    Now or Never
  • kinekine Member Posts: 12,562
    Just create new field in the PO, create same field with same no. in the purchase receipt header and purchase invoice header and that's all. Data will be copied automatically, you do not need any codeunit or any code for that...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • DenSterDenSter Member Posts: 8,305
    navuser1 wrote:
    but to this I hv to Create a single instance CU.
    Who told you that? It's just transfering a text value into a table field, I doubt you will need a single instance codeunit.
  • kapamaroukapamarou Member Posts: 1,152
    Read the help for command TRANSFERFIELDS. It will save you a lot of time in coding and searching for the places that the values are filled...
  • navuser1navuser1 Member Posts: 1,329
    kine wrote:
    Just create new field in the PO, create same field with same no. in the purchase receipt header and purchase invoice header and that's all. Data will be copied automatically, you do not need any codeunit or any code for that...


    This is the my first solution,
    but they(Seniors) don't want any new field.
    Now or Never
  • kinekine Member Posts: 12,562
    And have they some reason?
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • navuser1navuser1 Member Posts: 1,329
    kine wrote:
    And have they some reason?

    Table size problem.
    Now or Never
  • kinekine Member Posts: 12,562
    :D Ok, it seems that there is many field used for nothing and the one, you need to use for something cannot be added because other useless fields...

    Te cost for the one added field is much smaller than cost for modifying the necessary codeunit (if the field is not Text 250).
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • navuser1navuser1 Member Posts: 1,329
    Thanks for your most valuable reply Kine.
    Now or Never
  • David_SingletonDavid_Singleton Member Posts: 5,479
    navuser1 wrote:
    kine wrote:
    Just create new field in the PO, create same field with same no. in the purchase receipt header and purchase invoice header and that's all. Data will be copied automatically, you do not need any codeunit or any code for that...


    This is the my first solution,
    but they(Seniors) don't want any new field.

    I think you need to have them define the phrase "Seniors". This concept of Freshers and seniors is totally screwed up.

    What is needed is Mentors and Freshers. If these people want to call them selves seniors, then they need to act like seniors, and coach you to become a senior. They need to change their titles to Senior jerks.

    I am very happy that you came to the forum and asked for help like this. But I am very disappointed that you had to. Your boss should take serious action and remove these so called seniors from the company before they do more damage. They can not say "Um we are seniors, so our job is to screw up by adding too many fields, and the dump it all on the Freshers, so if they can't fix it we have someone to blame."

    Sorry for this rant, but I am just seeing this all too often these days.
    David Singleton
  • David_SingletonDavid_Singleton Member Posts: 5,479
    BTW Navuser1,

    I would like you to ask these so called "seniors" to post a reply here. I am on a crusade here 8)
    David Singleton
  • David_SingletonDavid_Singleton Member Posts: 5,479
    Also tell your Seniors about Kine's reply. That is the correct solution. Tell them they they need to first fix up their mess before giving you more work.

    Oh and if the field needs to be text205, then its the fault of bad design by the Analysts.
    David Singleton
  • SavatageSavatage Member Posts: 7,142
    I'm not understanding the problem myself - you want to transfer the info to the two other tables - so a new field in those tables are ok? so the complaint is about 1 single field. Sounds crazy!

    all you have to do is create the same field with same type & size using the same number (ie. 50020) and your done.
Sign In or Register to comment.