jumping to page url and filter invoice

kamranshehzadkamranshehzad Member Posts: 165
edited 2010-05-25 in NAV Three Tier
Hi I want to do something like this. I know I can do it with reports but I am not able to do it wth pages.
i want to launch a page with by specifying a invoice number.

for reports, i can see msdn documentation like
dynamicsnav:////runreport?report=104&filter=Customer.%22No.%22:"+1ST006

I have seen on msnd that you can do it with specifying a bookmark. but how do i generate automatic books marks? and how would i know whats the book mark for a particular sales invoice....

please guide.


regards,
KS

Answers

  • kinekine Member Posts: 12,562
  • kamranshehzadkamranshehzad Member Posts: 165
    Thanks kamil but i have got it working.
    I already checked this at freddy's blog but I need instant link to launch invoice from a list of invoices from excel.
    What i did is the following just in case some one else need it.

    I wrote a codeunit that generate bookmarks and compose a page url and return the url. I called that webservice in a .net assembly and registered it in analysis services database as an assembly and then queries it by giving document type and document number(parameters). and it worked for me.

    regards,
    KS
  • steptomesteptome Member Posts: 1
    Hey Kamran, can you share with us on how you got this done in a more detailed manner
  • kamranshehzadkamranshehzad Member Posts: 165
    sure no problem. the purpose i wanted to achieve is land on pages from external apps like excel etc. for this I wrote a code unit and exposed it as webservice. then i created a .net assembly and registered it and called the web service through that assembly. and used open query in excel, that returns the url.
    If you need fob / txt /xml, and .net assembly code, please pm me your email address.

    here the is code.
    Documentation()
    CU NAME: GET BOOKMARKS
    DEV BY : KAMRAN SHEHZAD
    DATE   : 12 APR 2010
    PURPOSE : TO GET NAVISION PAGE URLS FOR EXTERNAL APPS THROUGH EXPOSED CU AS WEBSERVICE
    
    OnRun()
    
    GETBOOKMARK(DocumentType : Text[30];EEDocumentNo : Code[20]) RetMsg : Text[30]
    
    CLEAR(RecRef);
    
    IF ISSERVICETIER THEN BEGIN
      CASE TRUE OF
        // FOR SALES INVOICES
        DocumentType IN ['SALES_INVOICE','DROP_SHIP_SALES_INVOICE','SUPPLIER_RETURN_LOGISTICS_COST','ZERO_COST_ZERO_SELL_INVOICE'
                          ,'VENDOR_INCOME_INVOICE','REPLACEMENT_INVOICE']:
         BEGIN
          RecSI.SETRANGE(RecSI."Pre-Assigned No.",EEDocumentNo);
            IF RecSI.FIND('-') THEN BEGIN
              NavDocNo:= RecSI."No.";
              RecRef.GETTABLE(RecSI);
              RetMsg := FORMAT(RecRef.RECORDID,0,10);
              EXIT;
            END;
          END;
        // FOR CREDIT MEMOS
        DocumentType IN ['CREDIT_MEMO','DROP_SHIP_CREDIT_MEMO','VENDOR_INCOME_CREDIT_MEMO']:
         BEGIN
           RecCM.SETRANGE(RecCM."Pre-Assigned No.",EEDocumentNo);
            IF RecCM.FIND('-') THEN BEGIN
              NavDocNo:= RecCM."No.";
              RecRef.GETTABLE(RecCM);
              RetMsg := FORMAT(RecRef.RECORDID,0,10);
              EXIT;
            END;
         END;
      END;
    END;
    
    GETPAGEURL(DocumentType : Text[30];EEDocumentNo : Code[20]) RetMsg : Text[1000]
    CASE TRUE OF
      DocumentType IN ['SALES_INVOICE','DROP_SHIP_SALES_INVOICE','SUPPLIER_RETURN_LOGISTICS_COST','ZERO_COST_ZERO_SELL_INVOICE'
                      ,'VENDOR_INCOME_INVOICE','REPLACEMENT_INVOICE']:
        BEGIN
           UrlPage:='132';
           PageBookMark:= GETBOOKMARK(DocumentType,EEDocumentNo);
        END;
      
      DocumentType IN ['CREDIT_MEMO','DROP_SHIP_CREDIT_MEMO','VENDOR_INCOME_CREDIT_MEMO']:
        BEGIN
           UrlPage:='134';
           PageBookMark:= GETBOOKMARK(DocumentType,EEDocumentNo);
        END;
    END;
      Url := UrlPrefix + CompanyName + UrlCommand + UrlPage + UrlBookMark + PageBookMark;
      RetMsg := Url;
    
    
    KS
Sign In or Register to comment.