Newbie needs help with form design

Bugg_SuperstarBugg_Superstar Member Posts: 5
edited 2003-09-09 in Navision Attain
Hi all,

I'm a complete newbie to form design/modification, having spent the past few weeks teaching myself the basics (not on our live database I must add!). But now I want to get into some more complicated stuff that, at the moment, is beyond me. (This is in Navision 3.60, I almost forgot to mention that!).

What I'd like to do is modify Form 130, Posted Sales Shipment, in three ways:

1. Remove 'Undo Shipment' from the Functions menu and create a new button to perform this action.
2. Turn the 'No.' field on the header into a lookup field that links to and opens the relevant Sales Order.
3. Have the name of the user that performs the 'undo shipment' action appear on the posted sales shipment header.

And here's what I've done so far:

1. I've removed (well, hidden) access to 'Undo Shipment' off the menu and have created a new button. But how do I make this new button perform the undo shipment action?
2. I can't get this to work at all. I can edit the field properties and set it to Lookup = Yes, and set the LookupFormID to Sales Order (42), but nothing happens when you click in the field and do a lookup.
3. This one isn't as important (at the moment), but it would be nice if I could get this working.

By now I expect one or two of you are saying that I should go on a course to learn these things. Well, that would be nice, but this sort of thing isn't really part of my job so I can't justify asking my boss if the company will pay for me to learn this stuff. Maybe there are some training guides or manuals out there that I would find useful? How difficult is it to learn these things? I'm prepared to put in the hours out of work because I really think it will be a benefit to be able to do this.

Thanks for the help!

Comments

  • eromeineromein Member Posts: 589
    You wil need a development license to do this. So i'll keep it short, in case you don't have one i didn't spend to much time for nothing ;)


    1.) If you go ot the menu item undo shipment in the function button and press F9 you should see some C/AL code (program lines) Copy past these to the same trigger (OnPush) of the new button you made. Little tip, make sure the glue properties of your new button are correct.

    2.) Do NOT change the No field into a look-up, this is not Navision style. Keep programming like standaard Navision! What you could do is program a new function menu item that shows this list you want. If you need help on this one, just ask.

    3.) You will have to log this per line. Different people can undo different lines. So create an extra field in the sales shipment line table and fill in from the codeunit thal undo's the sipment. This is called something like "Undo sales shipment line" or something. But again, you'll need a developers license.
    "Real programmers don't comment their code.
    If it was hard to write, it should be hard to understand."
  • Bugg_SuperstarBugg_Superstar Member Posts: 5
    Hi,

    We do indeed have a development license, so your time was certainly not wasted :)

    I've now got No.1 on my list working (it's easy when you know how!) and plan to have a look at your suggestions for No's 2 & 3 later today. So thanks for the help so far, but I may be back for more later!
  • Bugg_SuperstarBugg_Superstar Member Posts: 5
    I've had a crack at #2 and am a bit stuck so I would appreciate any help!

    I've set the C/AL code OnLookup to FORM.RUN(42) on the Order No. field. The lookup now works but doesn't take you to the required record (ie, the currently selected Order No.). How do I do this?

    Thanks!
  • eromeineromein Member Posts: 589
    do something like this: (Code has not been checked)
    OnLookUp();
    
    SalesHeader.reset;
    SalesHeader.Setrange("No.","Order No."); // Filter relevant orders.
    
    form.runmodal(form::"Sales order list",salesheader);
    
    "Real programmers don't comment their code.
    If it was hard to write, it should be hard to understand."
  • Bugg_SuperstarBugg_Superstar Member Posts: 5
    Thank you! I had to define 'SalesHeader' in the C/AL Globals and change 'Sales order list' to 'Sales order', but it all works.

    Thanks for your help with this :D
  • eromeineromein Member Posts: 589
    np, dude.

    Just post if you need some extra help!
    "Real programmers don't comment their code.
    If it was hard to write, it should be hard to understand."
Sign In or Register to comment.